<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>食品网</title>
    <link rel="shortcut icon" href="favicon.ico" />
    <link rel="stylesheet" href="../static/css/base.css">
    <link rel="stylesheet" href="../static/css/common.css">
    <link rel="stylesheet" href="../static/css/index_test.css">
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.js"></script>
    <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script>
    <script src="https://ajax.aspnetcdn.com/ajax/jquery.ui/1.10.4/jquery-ui.min.js"></script>
    <script src="../static/script/base.js"></script>
    <script src="../static/script/slide.js"></script>
</head>

<body>
    <!-- 快捷导航模块开始 -->
    <section class="shortcut">
        <div class="width">
            <div class="fl">
                <ul>
                    <li>食品网欢迎您！&nbsp;</li>
                    <li>
                        请<a href="login.html" class="style_green">登录</a>
                        <a href="register.html" class="style_green">&nbsp;免费注册</a>
                    </li>
                </ul>
            </div>
            <div class="fr">
                <ul>
                    <li>我的订单</li>
                    <li>|</li>
                    <li>我的食品网<span></span></li>
                    <li>|</li>
                    <li>食品网会员</li>
                    <li>|</li>
                    <li>关注我们<span></span></li>
                    <li>|</li>
                    <li>客户服务<span></span></li>
                    <li>|</li>
                    <li>网站导航<span></span></li>
                </ul>
            </div>
        </div>
    </section> -->
    <!-- 快捷导航模块结束 -->
    <!-- 头部制作模块开始 -->
    <header class="header width">
        <a href="index.html" class="logo"></a>
        <div class="search">
            <input type="search" name="" id="id_key" placeholder="中华老字号">
            <button id="id_search">搜索</button>
        </div>
        <div class="hotwords">
            <a href="#" class="style_red">葡萄酒</a>
            <a href="#">饼干蛋糕</a>
            <a href="#">咖啡粉</a>
            <a href="#">营养食品</a>
            <a href="#">膨化食品</a>
            <a href="#">坚果炒货</a>
            <a href="#">猪肉</a>
        </div>
    </header>
    <!-- 头部制作模块结束 -->
    <!-- 右侧边栏制作开始 -->
    <div class="sidebar">
        <ul class="box">
            <li class="user" id="id_acount">
                <a href="/user/acount">
                    <span></span>
                    账号
                </a>
            </li>
            <li class="shopping_bag">
                <a href="#" id="id_cart">
                    <span></span>
                    购物车<br>
                    <i class="count">8</i>
                </a>
            </li>
            <li class="order">
                <a href="#">
                    <span></span>
                    订单
                </a>
            </li>
            <li class="collection" id="id_collection">
                <a href="#">
                    <span></span>
                    收藏
                </a>
            </li>
            <li class="complaint">
                <a href="#">
                    <span></span>
                    投诉
                </a>
            </li>
            <li class="top">
                <a href="#top">
                    <span></span>
                </a>
            </li>
        </ul>
    </div>
    <!-- 右侧边栏制作结束 -->
    <!-- nav模块开始 -->
    <nav class="nav">
        <div class="width">
            <div class="dropdown">
                <div class="dt">全部商品分类</div>
                <div class="dd">
                    <ul>
                        <li><a href="#">新鲜水果<span>></span></a></li>
                        <li><a href="#">蔬菜蛋品<span>></span></a></li>
                        <li><a href="#">精选肉类<span>></span></a></li>
                        <li><a href="#">海鲜水产<span>></span></a></li>
                        <li><a href="#">冷冻食品<span>></span></a></li>
                        <li><a href="#">中外名酒<span>></span></a></li>
                        <li><a href="#">进口食品<span>></span></a></li>
                        <li><a href="#">休闲食品<span>></span></a></li>
                    </ul>
                </div>
            </div>
        </div>
    </nav>
    <!-- nav模块结束 -->
    <!-- focus模块开始 -->
    <div class="width">
        <div class="slide">
            <ul class="slide_pics">
                <li><img src="../static/upload/focus1.jpg" alt=""></li>
                <li><img src="../static/upload/focus2.jpg" alt=""></li>
                <li><img src="../static/upload/focus2.jpg" alt=""></li>
                <li><img src="../static/upload/focus2.jpg" alt=""></li>
                <li><img src="../static/upload/focus2.jpg" alt=""></li>
            </ul>
            <div class="prev"><</div>
            <div class="next">></div>
            <ul class="points">

            </ul>
        </div>
    </div>
    <!-- focus模块结束 -->
    <!-- 楼层区域开始 -->
    <div class=" width floor">
        <div class="floor_hd">
            <div class="border1"></div>
            <h1>为你推荐</h1>
            <div class="border2"></div>
        </div>
        <div class="fruit" id="id_goods_model">
{#            <div class="box_bd">#}
{#                <ul>#}
{#                    <li><a href="#"><img src="../static/upload/fruit1.jpg" alt=""></a></li>#}
{#                    <li><a href="#"><img src="../static/upload/fruit2.jpg" alt=""></a></li>#}
{#                    <li><a href="#"><img src="../static/upload/fruit3.jpg" alt=""></a></li>#}
{#                    <li><a href="#"><img src="../static/upload/fruit4.jpg" alt=""></a></li>#}
{#                    <li><a href="#"><img src="../static/upload/fruit5.jpg" alt=""></a></li>#}
{#                </ul>#}
{#            </div>#}
        </div>
    </div>
    <!-- 楼层区域结束 -->
    <!-- 底部模块开始 -->
    <footer class="footer">
        <div class="width">
            <div class="mod_service">
                <ul>
                    <li>
                        <div class="service_icon1"></div>
                        <div class="text">
                            <h3>品类齐全，轻松购物</h3>
                        </div>
                    </li>
                    <li>
                        <div class="service_icon2"></div>
                        <div class="text">
                            <h3>多仓直发，极速配送</h3>
                        </div>
                    </li>
                    <li>
                        <div class="service_icon3"></div>
                        <div class="text">
                            <h3>正品行货，精致服务</h3>
                        </div>
                    </li>
                    <li>
                        <div class="service_icon4"></div>
                        <div class="text">
                            <h3>天天低价，畅选无忧</h3>
                        </div>
                    </li>
                </ul>
            </div>
            <div class="mod_help">
                <dl>
                    <dt>
                        <a href="#">服务指南</a>
                    </dt>
                    <dd><a href="#">购物流程</a></dd>
                    <dd><a href="#">会员介绍</a></dd>
                    <dd><a href="#">生活旅行/团购</a></dd>
                    <dd><a href="#">常见问题</a></dd>
                    <dd><a href="#">联系客服</a></dd>
                </dl>
                <dl>
                    <dt><a href="#">配送方式</a></dt>
                    <dd><a href="#">上门自提</a></dd>
                    <dd><a href="#">211限时达</a></dd>
                    <dd><a href="#">配送服务查询</a></dd>
                    <dd><a href="#">配送费收取标准</a></dd>
                    <dd><a href="#">海外配送</a></dd>
                </dl>
                <dl>
                    <dt><a href="#">支付方式</a></dt>
                    <dd><a href="#">货到付款</a></dd>
                    <dd><a href="#">在线支付</a></dd>
                    <dd><a href="#">分期付款</a></dd>
                    <dd><a href="#">公司转账</a></dd>
                </dl>
                <dl>
                    <dt><a href="#">售后服务</a></dt>
                    <dd><a href="#">售后政策</a></dd>
                    <dd><a href="#">价格保护</a></dd>
                    <dd><a href="#">退款说明</a></dd>
                    <dd><a href="#">返修/退换货</a></dd>
                    <dd><a href="#">取消订单</a></dd>
                </dl>
                <dl>
                    <dt><a href="#">特色服务</a></dt>
                    <dd><a href="#">夺宝岛</a></dd>
                    <dd><a href="#">DIY装机</a></dd>
                    <dd><a href="#">延保服务</a></dd>
                </dl>
                <dl>
                    <dt>帮助中心</dt>
                    <dd class="qrcode">
                        <img src="../static/images/QRcode.png" alt="">
                    </dd>
                    下载客户端
                </dl>
            </div>
            <div class="mod_copyright">
                <div class="links">
                    <a href="#">关于我们</a>|
                    <a href="#">联系我们</a>|
                    <a href="#">联系客服</a>|
                    <a href="#">商家入驻</a>|
                    <a href="#">营销中心</a>|
                    <a href="#">友情链接</a>|
                    <a href="#">销售联盟</a>|
                    <a href="#">食品网社区</a>|
                    <a href="#">English Site</a>|
                    <a href="#">Contact U</a>|
                </div>
                <div class="copyright">
                    地址：内蒙古师范大学盛乐校区 邮编：010000 电话：400-123-1234 传真：010-12345678 邮箱: 1234567@567.com</br>
                    蒙ICP备08001234号蒙公网安备110123456789
                </div>
            </div>
        </div>
    </footer>
    <script>
        var page = 1
        var size = 5
        $(document).ready(function(){
            carFunction()
            loadGoods(page,size)
        });
    </script>
    <!-- 底部模块结束 -->
    <script>
        $("#id_search").click(function (){
            var key = $("#id_key").val()
            window.location.href = "/search?keyword="+key+"&page="+0+"&size="+10;
        })
    </script>
    <script>
        var loadGoods=function(cur,size){
            $.ajax({
                url:"goods/page",
                type:"get",
                data:{page:cur,size:size},
                success:function (result){
                    var data = result.data
                    console.log(result)
                    console.log(data)
                    var content="<div class='box_bd'><ul>"
                    for(var i=0;i<data.length;++i){
                        content+= "<li class='g_item' id = "+data[i].id+"><a href='#'><img src="+data[i].img+"  alt=''></a></li>"
                    }
                    content+="</ul></div>"
                    $("#id_goods_model").append(content)
                    console.log(content)
                }
            })
        }
    </script>
    <script>
      $(function(){
        $(window).scroll(function() {
          var scrollTop = $(this).scrollTop();
          var scrollHeight = $(document).height();
          var windowHeight = $(this).height();
          if(scrollTop + windowHeight == scrollHeight){
              loadGoods(page,size)
              page+=1
          }
        })
      })
    </script>
    <script>
        $(document).on('click','.g_item',function (){
            object = $(this)
            var host = window.location.origin
            window.open(host + "/goods/detail?id="+object.attr("id"))
        })
    </script>
</body>

</html>